﻿Namespace Seguranca.Dominio

    ''' <summary>
    ''' Classe Usuário de Segurança
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()> _
    Public Class Usuario

        Private _id As Long

        ''' <summary>
        ''' Identificador da Segurança
        ''' </summary>
        ''' <value>Long</value>
        ''' <returns>Long</returns>
        ''' <remarks></remarks>
        Public Overridable Property Id() As Long
            Get
                Return _id
            End Get
            Set(ByVal value As Long)
                _id = value
            End Set
        End Property

        'Código do usuário no sistema acadêmico
        Private _codigoExterno As String
        ''' <summary>
        ''' Trata-se do Login do usuário no sistema original de autenticação.
        ''' O sistema de origem dos usuários no momento é o SigaUm (Oracle)
        ''' </summary>
        ''' <value>String</value>
        ''' <returns>String</returns>
        ''' <remarks></remarks>
        Public Overridable Property CodigoExterno() As String
            Get
                Return _codigoExterno
            End Get
            Set(ByVal value As String)
                _codigoExterno = value
            End Set
        End Property

        Private _papeis As IList(Of Papel)
        ''' <summary>
        ''' Propriedade _papeis
        ''' </summary>
        ''' <value>Lista(classe Papel)</value>
        ''' <returns>Lista(classe Papel)</returns>
        ''' <remarks></remarks>
        Public Overridable Property Papeis() As IList(Of Papel)
            Get
                Return _papeis
            End Get
            Set(ByVal value As IList(Of Papel))
                _papeis = value
            End Set
        End Property

        Public Overridable Sub adicionaPapel(ByVal _papel As Papel)
            If IsNothing(_papeis) Then
                _papeis = New List(Of Papel)
            End If
            _papeis.Add(_papel)
        End Sub

        Private _email As String
        Public Overridable Property Email() As String
            Get
                Return _email
            End Get
            Set(ByVal value As String)
                _email = value
            End Set
        End Property

        Private _Telefone As String
        Public Overridable Property Telefone() As String
            Get
                Return _Telefone
            End Get
            Set(ByVal value As String)
                _Telefone = value
            End Set
        End Property

        Private _Nome As String
        Public Overridable Property Nome() As String
            Get
                Return _Nome
            End Get
            Set(ByVal value As String)
                _Nome = value
            End Set
        End Property

        <Obsolete("Não é mais oferecido suporte a essa propriedade. Somente o SigaUm detêm o conhecimento da senha.")> _
        Public Overridable Property Senha() As String
            Get
            End Get
            Set(ByVal value As String)
            End Set
        End Property

        Private _SenhaFinanceira As String
        Public Overridable Property SenhaFinanceira() As String
            Get
                Return _SenhaFinanceira
            End Get
            Set(ByVal value As String)
                _SenhaFinanceira = value
            End Set
        End Property

        Private _SenhaImpressaoContrato As String
        Public Overridable Property SenhaImpressaoContrato() As String
            Get
                Return _SenhaImpressaoContrato
            End Get
            Set(ByVal value As String)
                _SenhaImpressaoContrato = value
            End Set
        End Property

        Private _Ativo As Nullable(Of Boolean)
        Public Overridable Property Ativo() As Nullable(Of Boolean)
            Get
                Return _Ativo
            End Get
            Set(ByVal value As Nullable(Of Boolean))
                _Ativo = value
            End Set
        End Property

        Private _DataCriacao As Nullable(Of Date)
        Public Overridable Property DataCriacao() As Nullable(Of Date)
            Get
                Return _DataCriacao
            End Get
            Set(ByVal value As Nullable(Of Date))
                _DataCriacao = value
            End Set
        End Property

        Private _AcessaSGP As Nullable(Of Boolean)
        Public Overridable Property AcessaSGP() As Nullable(Of Boolean)
            Get
                Return _AcessaSGP
            End Get
            Set(ByVal value As Nullable(Of Boolean))
                _AcessaSGP = value
            End Set
        End Property

    End Class
End Namespace